<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%--通过page指令的isErrorPage属性显示指定当前JSP对应的servlet可以用于处理异常--%>
<%--当page指令的isErrorPage为true时才会在当前JSP对应的servlet程序中定义exception变量 --%>
<%@ page isErrorPage="true" %>

<html>
    <head>
        <title>内置对象</title>
        <style>
            .wrapper {
                border: 1px solid blue;
                margin: 15px auto;
            }
            h3 {
                text-align: center;
            }
            .container {
                display: flex;
                justify-content: space-between;
                border: 1px solid green;
                margin: 10px;
            }
            aside.item {
                flex-basis: 18%;
                text-align: right;
            }
            main.item {
                flex-basis: 80%;
            }
        </style>
    </head>
    <body>

        <div class="wrapper">
            <h3>用JSP表达式输出JSP标准内置对象</h3>
            <div class="container">
                <aside class="item">
                    request:
                </aside>
                <main class="item">
                    <%= request %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    response:
                </aside>
                <main class="item">
                    <%= response %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    session:
                </aside>
                <main class="item">
                    <%= session %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    application:
                </aside>
                <main class="item">
                    <%= application %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    config:
                </aside>
                <main class="item">
                    <%= config %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    out:
                </aside>
                <main class="item">
                    <%= out %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    page:
                </aside>
                <main class="item">
                    <%= page %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    pageContext:
                </aside>
                <main class="item">
                    <%= pageContext %>
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    exception:
                </aside>
                <main class="item">
                    <%= exception %>
                </main>
            </div>
        </div>

        <div class="wrapper">
            <h3>用EL表达式输出JSP标准内置对象</h3>
            <div class="container">
                <aside class="item">
                    pageContext:
                </aside>
                <main class="item">
                    ${ pageContext }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    page:
                </aside>
                <main class="item">
                    ${ pageContext.page }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    request:
                </aside>
                <main class="item">
                    ${ pageContext.request }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    response:
                </aside>
                <main class="item">
                    ${ pageContext.response }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    session:
                </aside>
                <main class="item">
                    ${ pageContext.session }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    application:
                </aside>
                <main class="item">
                    ${ pageContext.servletContext }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    config:
                </aside>
                <main class="item">
                    ${ pageContext.servletConfig }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    out:
                </aside>
                <main class="item">
                    ${ pageContext.out }
                </main>
            </div>
            <div class="container">
                <aside class="item">
                    exception:
                </aside>
                <main class="item">
                    ${ pageContext.exception }
                </main>
            </div>
        </div>

    </body>
</html>
